cmake_minimum_required(VERSION 3.0.2)
project(robot_thermal)

## Compile as C++11, supported in ROS Kinetic and newer
add_compile_options(-std=c++11)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/bin)

set(CMAKE_BUILD_TYPE Release)
MESSAGE("Build type:  " ${CMAKE_BUILD_TYPE})

set(libPath ${CMAKE_SOURCE_DIR})
message(libPath:  ${libPath})

include_directories(
 ${PROJECT_SOURCE_DIR}/include
 ${PROJECT_SOURCE_DIR}/../ThirdPart/
 ${PROJECT_SOURCE_DIR}/../ThirdPart/threadPool/include
 ${PROJECT_SOURCE_DIR}/../ThirdPart/Json/include
 ${PROJECT_SOURCE_DIR}/../ThirdPart/loger/include
 ${PROJECT_SOURCE_DIR}/../ThirdPart/utilsTools/include
 ${PROJECT_SOURCE_DIR}/../ThirdPart/socketDataParse/include
 ${PROJECT_SOURCE_DIR}/../ThirdPart/worker/include


 ${PROJECT_SOURCE_DIR}/../ThirdPart/0_include/opencv
)

link_directories(
 ${PROJECT_SOURCE_DIR}/lib
)


find_library(libJson NAMES libJson.so PATHS  ${PROJECT_SOURCE_DIR}/../ThirdPart/Json/lib)
MESSAGE(${libJson})
find_library(worker NAMES libworker.so PATHS ${PROJECT_SOURCE_DIR}/../ThirdPart/worker/lib)
MESSAGE(${worker})
find_library(threadPool NAMES libthreadPool.so PATHS ${PROJECT_SOURCE_DIR}/../ThirdPart/threadPool/lib)
MESSAGE(${threadPool})
find_library(utilsTools NAMES libutilsTools.so PATHS ${PROJECT_SOURCE_DIR}/../ThirdPart/utilsTools/lib)
MESSAGE(${utilsTools})

MESSAGE(>>> find opencvLibs ...)
file(GLOB opencvLibs ${PROJECT_SOURCE_DIR}/../ThirdPart/0_lib/opencv/opencv2/*.so)
SET( opencvLibs ${opencvLibs})
MESSAGE(so: ${opencvLibs}) 

MESSAGE(>>> find hikLibs ...)
file(GLOB hikso ${PROJECT_SOURCE_DIR}/lib/*.so)
SET( hikso ${hikso})
MESSAGE(so: ${hikso}) 
file(GLOB hikso_HCNetSDKCom ${PROJECT_SOURCE_DIR}/lib/HCNetSDKCom/*.so)
SET( hikso_HCNetSDKCom ${hikso_HCNetSDKCom})
MESSAGE(so: ${hikso_HCNetSDKCom}) 

set(LIBS 
  ${opencvLibs}
  ${libJson}
  ${worker}
  ${utilsTools}

  ${hikso}
  ${hikso_HCNetSDKCom}
)

add_executable(demo
  ${PROJECT_SOURCE_DIR}/demo.cpp
  ${PROJECT_SOURCE_DIR}/src/worker_x.cpp
  ${PROJECT_SOURCE_DIR}/src/checkResult.cpp
  ${PROJECT_SOURCE_DIR}/src/thermalcam.cpp
)
target_link_libraries(demo
  ${LIBS}

)
